/*
 * threadcondition.h
 *
 *  Created on: 2012-5-2
 *      Author: epmm
 */

#ifndef THREADCONDITION_H_
#define THREADCONDITION_H_

class CThreadCondition
{
	pthread_mutex_t m_mtx;
	pthread_cond_t m_cond;
public:
	CThreadCondition();
	virtual ~CThreadCondition();
public:

	int Signal();
	int BroadCast();

	int Wait(CThreadMutex&  mutex);
	int TimedWait(CThreadMutex& mutex,int nMinutes);

	timespec* MakeTimeout(struct timespec* tsp,int nMinutes);
};

#endif /* THREADCONDITION_H_ */
